package com.gyy.constants;


/**
 * @Author gmd
 * @Description Modbus数据类型描述，对标com.serotonin.modbus4j.code.DataType，是对该类常量的描述说明
 * @Date 2022-01-10 10:44:57
 */
public enum DataType {

    BINARY(1, "二进制"),

    TWO_BYTE_INT_UNSIGNED(2, "两个字节的无符号整数"),

    TWO_BYTE_INT_SIGNED(3, "双字节有符号整数"),

    TWO_BYTE_INT_UNSIGNED_SWAPPED(22, "双字节无符号交换整数"),

    TWO_BYTE_INT_SIGNED_SWAPPED(23, "双字节有符号交换整数"),

    FOUR_BYTE_INT_UNSIGNED(4, "四字节无符号整数"),

    FOUR_BYTE_INT_SIGNED(5, "四字节有符号整数"),

    FOUR_BYTE_INT_UNSIGNED_SWAPPED(6, "四字节无符号交换整数"),

    FOUR_BYTE_INT_SIGNED_SWAPPED(7, "四字节有符号交换整数"),

    FOUR_BYTE_INT_UNSIGNED_SWAPPED_SWAPPED(24, "四字节无符号交换整数"),

    FOUR_BYTE_INT_SIGNED_SWAPPED_SWAPPED(25, "四字节有符号交换整数"),

    FOUR_BYTE_FLOAT(8, "四字节浮点数"),

    FOUR_BYTE_FLOAT_SWAPPED(9, "四字节交换浮点数"),

    FOUR_BYTE_FLOAT_SWAPPED_INVERTED(21, "四字节交换倒换浮点数"),

    FOUR_BYTE_FLOAT_INVERTED(26, "四字节浮点数"),

    FOUR_BYTE_FLOAT_SWAPPED_SWAPPED(27, "四字节交换交换浮点数"),

    EIGHT_BYTE_INT_UNSIGNED(10, "八字节无符号整数"),

    EIGHT_BYTE_INT_SIGNED(11, "八字节有符号整数"),

    EIGHT_BYTE_INT_UNSIGNED_SWAPPED(12, "八字节无符号交换整数"),

    EIGHT_BYTE_INT_SIGNED_SWAPPED(13, "八字节有符号交换整数"),

    EIGHT_BYTE_FLOAT(14, "八字节浮点数"),

    EIGHT_BYTE_FLOAT_SWAPPED(15, "八字节交换浮点数"),

    TWO_BYTE_BCD(16, "两个字节的BCD"),

    FOUR_BYTE_BCD(17, "四字节BCD"),

    FOUR_BYTE_BCD_SWAPPED(20, "四字节交换BCD"),

    CHAR(18, "字符"),

    VARCHAR(19, "字符串");


    DataType(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

    /**
     * 数值
     */
    private Integer type;

    /**
     * 描述
     */
    private String desc;

}
